/* 
 * File:   TUFile.h
 * Author: arschmitz
 *
 * Created on April 3, 2011, 12:13 PM
 */
#ifndef TUFILE_H
#define TUFILE_H
#include <cstdio>
#define BUFSIZE 200
#define MAXNAME 80

class TUFile: public TUObject {
public:
    void *operator new(unsigned long size);
    TUFile();
    void *operator new(unsigned long size, const char *filename, FILE *file);
    TUFile(const char *filename, FILE *file);
    bool operator==(TUObject *object);
    ~TUFile();
    char *getFileName();
    static long getFileSize(FILE *file);
    void *getFileData();
    bool hasNext();
    char *getNext();
private:
    // Helpers for reading the attached data
    char readBuffer[BUFSIZE];
    int currentFilePtr;
    // Traditional variables
    char myName[MAXNAME];
    long myFileSize;
    char myData[];
};

#endif    /* TUFILE_H */
